Removing all unused colors from the palette

Choose Remove Unused Colors in the Optimize panel Options pop-up menu to create the smallest file with the least number of colors. Deselect Remove Unused Colors to include all colors in the palette, including colors that are not present in the exported image.